<%@ include file="/common/taglibs.jsp"%>
<%@ page pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<!-- jquery -->
		<script src="${jquery}/jquery.js"></script>
		<script src="${jquery}/jquery.form.js"></script>
		<!-- tabletree4j -->
		<script src="${tabletree4j}/Core4j.js"></script>
		<script src="${tabletree4j}/TableTree4j.js"></script>
		<link rel="stylesheet" type="text/css"
			href="${tabletree4j}/tabletree4j.css">
		<!-- colorbox -->
		<script type="text/javascript"
			src="${colorbox}/jquery.colorbox-min.js"></script>
		<link rel="stylesheet" type="text/css" href="${colorbox}/colorbox.css">
		<!-- easyui -->
		<script type="text/javascript" src="${easyui}/jquery.easyui.min.js"></script>
		<link rel="stylesheet" type="text/css"
			href="${easyui}/themes/default/easyui.css">
		<!-- app -->
		<link rel="stylesheet" type="text/css" href="${app}/hnjz.css">
	</HEAD>

	<body>
		
			<form id="queryForm" method="post" action="saveQuxanxian.json">
				<div id="search" class="divContainer">
					<input class="i-text" type="text" id="role" name="role" value="${role}" />
					<span class="btn btn-ok"> <input type="submit" value="保存">
					</span>
					<a href="#" id="ref">刷新权限内存数据</a>
				</div>
				<div class="divContainer">
					<div id="worldcupgird"></div>
				</div>
			</form>
		
		<p>
	</body>
</HTML>
<SCRIPT LANGUAGE="JavaScript">
//create and config tabletree object
var fifaGirdTree=new Core4j.toolbox.TableTree4j({
	columns:[
			{isNodeClick:true,dataIndex:'title',width:'20%'},
			{dataIndex:'ops',width:'65%'},
			{dataIndex:'operate',width:'15%',canSort:false}
			],
	headers:[{
		  	columns:[
			{dataIndex:'name'},
		    {dataIndex:'ops'},
			{dataIndex:'operate'}
			],
			dataObject:{name:'功能名称',ops:'操作名称',operate:'操作'},
			trAttributeNames:['classStyle','style'],
			trAttributeValueObject:{classStyle:'ejiaA1_bt',style:''}
		  }
		],
	treeMode:'gird',
	renderTo:'worldcupgird',
	useLine:true,
	useIcon:true,
	id:'myworldcupgirdtree',
	useCookie:true,
	themeName:'arrow',
	selectMode:'single'
});

$('#queryForm').submit(function(){  
      $("#queryForm").ajaxSubmit({
     	  success: function(data){
	         $.messager.alert('保存结果:',data.msg);
	      }
	 });
     return false;  
});  

$(document).ready(function(){
    fifaGirdTree.build(${re},true);
    $("#ref").click(function(){
	  $.ajax({
			  url: "refQuxanxian.json",
			  success:function(data){
				  $.messager.alert('刷新结果:',data.msg);
			  }
			});
	});
    $('#role').combobox({
		url:'queryAllRole.json',
		valueField:'id',
		textField:'name',
		onSelect:function(){
		  var val = $('#role').combobox('getValue');
		  location.href="quanxianList.htm?role="+val;
		}
	});
});
</SCRIPT>